package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	BuyerBankCardEventNew           = "erp.BuyerBankCardNew"
	BuyerBankCardEventBeforeCreate  = "erp.BuyerBankCardBeforeCreate"
	BuyerBankCardEventBeforeUpdate  = "erp.BuyerBankCardBeforeUpdate"
	BuyerBankCardEventBeforeSave    = "erp.BuyerBankCardBeforeCreate erp.BuyerBankCardBeforeUpdate"
	BuyerBankCardEventAfterCreate   = "erp.BuyerBankCardAfterCreate"
	BuyerBankCardEventAfterUpdate   = "erp.BuyerBankCardAfterUpdate"
	BuyerBankCardEventAfterSave     = "erp.BuyerBankCardAfterCreate erp.BuyerBankCardAfterUpdate"
	BuyerBankCardEventDelete        = "erp.BuyerBankCardDelete"
	BuyerBankCardAccessControlEvent = "erp.BuyerBankCardAccessControl"
)

func GetBuyerBankCardConfig() *mgo.DocConfig {
	return BuyerBankCard_Config
}

var BuyerBankCard_Config *mgo.DocConfig

func init() {
	BuyerBankCard_Config = NewBuyerBankCardConfig()
}
func NewBuyerBankCardConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "erp.BuyerBankCard",
		Fields: []string{
			"buyer", "name", "bank", "bankName", "card",
		},
		RelationFields: []string{
			"buyer",
		},
		RelationConfigs: map[string]*mgo.DocRelation{
			"buyer": {
				Config:     GetBuyerConfig,
				DocName:    "Buyer",
				JoinType:   "O",
				KeyInside:  "buyerId",
				KeyOutSide: "id",
			},
		},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
